/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aiaudio.processing.reduce.klsh.kmeaning.reducers;

import aiaudio.database.tables.TemporaryTable;
import java.io.IOException;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.mapreduce.TableReducer;
import org.apache.hadoop.io.IntWritable;

/**
 *
 * @author nastya
 */
public class KMeansTestSetReducer extends TableReducer<ImmutableBytesWritable, IntWritable, ImmutableBytesWritable> {

    @Override
    protected void reduce(ImmutableBytesWritable key, Iterable<IntWritable> values, Context context) throws IOException, InterruptedException {
        for (IntWritable intWritable : values) {
            Put put = new Put(key.get());
            TemporaryTable.addDummyValue(put);
            context.write(new ImmutableBytesWritable(key), put);
        }
    }
    
}
